home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #058 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #058 (199x)(Scope PD)(US)[WB].adf
/
B1Subs
/
PixAminer
< prev
next >
Wrap
Text File
|
1989-01-24
|
5KB
|
182 lines
CLEAR,25000
DIM Code%(1220),Look$(200),F$(40),File0$(40)
WINDOW 1,,(0,20)-(500,124),23
WIDTH 77
ON BREAK GOSUB Ciao:BREAK ON
1
COLOR 2,1:CLS
'**** put a routine to get FileName$ here ***
'**** or just change the LISTing each time***
PRINT " INPUT the name of the picture you want to examine.
PRINT
PRINT "If it is not on this disk use the device name as in;
PRINT: COLOR 3
PRINT ,"DF1:XYZ.pic
PRINT: COLOR 2
PRINT " For a demonstration, just press RETURN.
INPUT F$
FileName$=F$
IF F$="" THEN FileName$= "OB"
CLS
PRINT ,"Checking ";FileName$
'**** The essentials for finding
'**** out whether a file is an IFF
'**** picture, and if so, what kind.
ON ERROR GOTO IOerror
OPEN FileName$ FOR INPUT AS 1
Look$="": i=0
WHILE i<180
Look$=Look$+INPUT$(1,1): i=i+1
WEND
CLOSE #1
ON ERROR GOTO 0
Wide = CVI(MID$(Look$,21,2))
High = CVI(MID$(Look$,23,2))
Deep = ASC(MID$(Look$,29,1))
MaxColor = 2^Deep-1
Mode = 1
IF Wide=640 THEN Mode=2
IF High=400 THEN Mode=Mode+2
IF Deep>5 THEN NoScreen=2
IF Wide=640 AND Deep>4 THEN NoScreen=3
IF MID$(Look$,9,4)<>"ILBM" THEN
PRINT: PRINT "Not a standard IFF file"
GOSUB WayCheer: GOTO Ciao
END IF
'**** The above essentials find
'**** out whether a file is an IFF
'**** picture, and if so, what kind.
'**** Now we'll print that info
'**** AND show what a Basic program
'**** listing for it would look like.
COLOR 3
PRINT " Width=";Wide;" Height=";High;
PRINT " Depth=";Deep;" Mode=";Mode;" MaxColor=";MaxColor
COLOR 2
PRINT " In a Basic program, this picture would need the following;"
PRINT " SCREEN 2,";Wide;CHR$(8);",";High;CHR$(8);",";Deep;CHR$(8);",";Mode;":",
COLOR 3:PRINT "REM SCREEN listing":COLOR 2
PRINT " WINDOW 2,,";
IF Wide>600 THEN PRINT "631,";:ELSE PRINT "311,";
IF High>240 THEN PRINT "384,";:ELSE PRINT "184,";
PRINT "16,2:",,
COLOR 3:PRINT "REM NO border"
PRINT ,"OR":COLOR 2
PRINT " WINDOW 2,";CHR$(34);"Title";CHR$(34);",";
IF Wide>600 THEN PRINT "631,";:ELSE PRINT "311,";
IF High>240 THEN PRINT "384,";:ELSE PRINT "184,";
PRINT "31,2:",
COLOR 3:PRINT "REM WITH border "
COLOR 2
'**** If it's a HAM picture we can
'**** load it, but not access it
'**** with Basic
IF NoScreen=2 THEN
PRINT
PRINT ,FileName$;" is a HAM picture.
PRINT: PRINT " It will be displayed, but not manipulated by AmigaBASIC."
PRINT: MaxColor=3: GOTO LoadaPicStuff
END IF
COLOR 3
PRINT " Do you want to create a screen and load it? ";
PRINT "Click on Y or N.
PRINT: COLOR 1,3: LOCATE 9: PRINT ," Y "
PRINT: PRINT ," N ": COLOR 3,1
WHILE NoPlace=LikeHome
XY=MOUSE(0): X=INT(MOUSE(1)/8): Y=INT(MOUSE(2)/8)
IF ABS(XY) AND X>15 AND X<20 THEN
IF Y=8 THEN LoadaPicStuff
IF Y=10 THEN Ciao
END IF
WEND
LoadaPicStuff:
LOCATE 11:COLOR 2
PRINT ,"Loading Assembly code
REM - Using assembly code by
REM - Charles VASSALLO
REM - 33 route des Traouieros
REM - 22730 Tregastel - France
REM - from the
REM - March 1988 JumpDisk
OPEN ":ILBM.code" FOR INPUT AS #1
i=0
WHILE NOT EOF(1)
INPUT#1,Code%(i): i=i+1
WEND
CLOSE #1: OpenFlag=0: GOSUB WayCheer
IF NoScreen=0 THEN
COLOR 0,1:PRINT, "Loading picture
WINDOW 1 ',,(0,20)-(200,60)
SCREEN 2,Wide,High,Deep,Mode
WINDOW 2,,,0,2
END IF
ILBMloading:
File0$=FileName$+CHR$(0)
ILBMload&=VARPTR(Code%(0))
CALL ILBMload&(SADD(File0$))
'OpenFlag=PEEK(2297+VARPTR(Code%(0)))
'PRINT OpenFlag
'**** end of ILBMloading
LOCATE 12
PRINT: PRINT " Draw, draw, draw "
PRINT: PRINT " Use RIGHT BUTTON on "
PRINT: PRINT " `SHOW OUTPUT' option "
PRINT: PRINT " for front screen "
COLOR 1,0
IF NoScreen THEN CLS
XY=MOUSE(0): OldX=MOUSE(1): OldY=MOUSE(2)
WHILE Hell=NotFrozenOver
XY=MOUSE(0): X=MOUSE(1): Y=MOUSE(2)
LOCATE 2,3:PRINT X,Y
LINE(X,Y)-(OldX,OldY),RND*MaxColor
OldX=X:OldY=Y
WEND
IOerror:
COLOR 3,1
PRINT ,FileName$ ;" is not here"
Tries=Tries+1
IF Tries>10 THEN COLOR 2:PRINT ,"To run again with different FileName":PRINT ," Just type `RUN'":GOTO Ciao
RESUME 0
Ciao:
WINDOW 1
WINDOW CLOSE 2: SCREEN CLOSE 2
CLEAR,25000
COLOR 1,2:LOCATE 13,15
PRINT " Thank you for your support. ";
LOCATE 9,1
COLOR 2,1
END
WayCheer:
XY=MOUSE(0):COLOR 3
PRINT ,"Click to load pic";
WHILE MOUSE(0)=0:SLEEP:WEND
WHILE ABS(MOUSE(0)):SLEEP:WEND
RETURN
'